import numpy as np

# 解方程组 2x + 3y = 8, 4x + y = 1
A = np.array([[2, 3], [4, 1]])
b = np.array([8, 1])
x = np.linalg.solve(A, b)
print(f"方程组的解: x = {x[0]:.1f}, y = {x[1]:.1f}")
# 输出: 方程组的解: x = -0.5, y = 3.0